﻿using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Reflection;
using System.Text;

namespace PoemGame.ComputerAnswer.Xml
{
    public class ComputerAnswerBase
    {
        protected readonly DataTable poemlinedt;
        protected readonly DataTable poetdt;

        public ComputerAnswerBase()
        {
            var ds = new DataSet();
            string resourceName = @"PoemGame.ComputerAnswer.Xml.data.PoemLine.Xml";
            Assembly someAssembly = Assembly.GetExecutingAssembly();
            
            using (Stream resourceStream = someAssembly.GetManifestResourceStream(resourceName))
            {
                ds.ReadXml(resourceStream);
                poemlinedt = ds.Tables[0];
            }
            var ds1 = new DataSet();
            string resourceName1 = @"PoemGame.ComputerAnswer.Xml.data.Poet.Xml";
            Assembly someAssembly1 = Assembly.GetExecutingAssembly();

            using (Stream resourceStream1 = someAssembly1.GetManifestResourceStream(resourceName1))
            {
                ds1.ReadXml(resourceStream1);
                poetdt = ds1.Tables[0];
            }

        }
    }
}
